<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>制作合同</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .table > tbody > tr > td {
            height: 35px;
            max-height: 44px;
            overflow: hidden;
        }

        .moduleName {
            float: left;
            height: 27px;
            line-height: 27px;
            font-size: 22px;
            width: 100px;
            text-align: center;
        }

        .tryStyle {
            width: 30px;
            height: 14px;
            line-height: 14px;
            font-size: 12px;
            /* top: 0; */
            right: 0;
            position: absolute;
            border-radius: 5px;
            margin-top: 1px;
            background: red;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.8);
        }

        .nav-tabs-custom {
            margin-bottom: 0;
            box-shadow: none;
            position: relative;
        }

        span.lineOne {
            line-height: 28px;
            height: 28px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }
        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .table-detail td.twoLine {
            line-height: 1.5 !important;
            padding: 3px 0 !important;
        "
        }

        .table-detail select {
            text-indent: 0 !important;
            padding-left: 0 !important;
            margin-left: -4px !important;
        }

    </style>
</head>
<body>
<section class="content" id="app">
    <iframe id="ifExprot" style="width:0px;height:0px;display: none;" frameborder="0"></iframe>
    <div class="div-td-content-more"><i></i></div>
    <div class="templateStyle">
        <div class="nav-tabs-custom oaReportNav">
            <!--</ul>-->
            <!--<div style="height: 25px; margin-bottom: 10px;">
                <input type="text" placeholder="合同编号" class="form-control pull-left input-sm"
                       style="width: 100px;" v-model="searchParams.contractNo" id="txtParent">
                <div class="pull-left" style="width: 100px;margin-left: 10px;">
                    <select id="selectRole" v-model="searchParams.brandName"
                            style="    width: 100%;height: 25px;font-size: 12px;line-height: 25px;padding-top: 0px;padding-bottom: 0px;padding-left: 6px;">
                        <option value="品牌" >品牌</option>
                        <option v-for="itemB in itemsBran" v-bind:value="itemB.name">{{itemB.name}}</option>
                    </select>
                </div>

                <input type="text" placeholder="机型" class="form-control pull-left input-sm"
                       style="width: 100px; margin-left: 10px;" v-model="searchParams.modelName"
                       id="regionManagerName">
                <input type="text" placeholder="序列号" class="form-control pull-left input-sm"
                       style="width: 100px; margin-left: 10px;" v-model="searchParams.serialNo" id="">

                <button type="button" class="btn oaBtn btn-sm pull-left" style="margin-left: 10px;" @click="search">
                    查询
                </button>
            </div>-->
        </div>
    </div>
    <div class="box-body no-padding iframeH2" style="overflow: auto;" id="scrollDiv">
        <div id="progress" class="wyui-progress"></div>
        <table class="table table-hover table-bordered text-center table-striped">
            <thead>
            <tr>
                <!--<th style="width:20px;">-->
                <!--<input type="checkbox" id="checkAll" v-model="isCheckedAll"-->
                <!--v-if="pageType=='pay'"/>-->
                <!--</th>-->
                <!--<th style="width: 50px">序号</th>-->
                <!--<th>合同类型</th>-->
                <th style="width:10%">合同编号</th>
                <!--<th>区域经理</th>-->
                <th style="width:8%">买方(公司名称)</th>
                <th style="width:6%">品牌</th>
                <th style="width:6%">设备类型</th>
                <th style="width:10%">机型</th>
                <th style="width:6%">序列号</th>
                <th style="width:8%">操作</th>
            </tr>
            </thead>
            <tbody id="tbList">
            <tr v-for="(item,i) in list.main">
                <!--<td>{{i+1}}</td>-->
                <td>{{item.contractNo}}</td>
                <td><span class="lineOne">{{item.buyer}}</span></td>
                <td>{{item.brandName}}</td>
                <td>{{item.deviceType}}</td>
                <td>{{item.modelName}}</td>
                <!--<td>{{item.serialNo}}</td>-->
                <td>{{item.serialNo}}</td>
                <td>
                    <a href="javascript:void(0);" @click="ok(item.id,item.contractNo,item.buyer)">选择</a>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="oa-pager text-center" style="margin-top: 5px;">
            共
            <span id="allCount"> 0 </span>条记录&nbsp;&nbsp;&nbsp;
            <span id="nowPage"> 1 </span>/<span id="allPage">1</span>&nbsp;&nbsp;&nbsp;
            <span class="oa-pager-button" id="first">首页</span>
            <span class="oa-pager-button" id="prev">上一页</span>
            <span class="oa-pager-button" id="next">下一页</span>
            <span class="oa-pager-button" id="last">尾页</span>
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=558d0414"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script src="/dist/plugins/select2/select2.full.min.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + 12 + "px",
                        "left": $(this).offset().left - 6,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    function refresh() {
        $.wyui.page.getByPage();
    }
    var app = new Vue({
        el: '#app',
        data: {
            itemsBran:[],
            list: {
                // verifying: '',
                // pass: '',
                main: [],
            },
            searchParams: {
                contractNo: '',
                modelName: '',
                serialNo: '',
                brandName: '品牌'
            },
        },
        methods: {
            ok:function (id,contractNo,buyer) {
               parent.getParam(id,contractNo,buyer);
                api.close();
            },
            search: function () {
                $.wyui.page.queryParams.requestPage = 1;
                $.extend($.wyui.page.queryParams, this.searchParams);
                $.wyui.page.getByPage();
            },

        },
        mounted: function () {
            var that=this;
            $.wyui.postMethod('/deviceBrand/getBrandList2.json',{},function (r) {
                that.itemsBran = r.brands;
            })
        }
    });
    //分页
    $.wyui.page.dataUrl = server.ip + "/contractMain/selectContractList.json";
    $.wyui.page.queryParams.pageType = $.wyui.page.urlParams.pageType;
    $.wyui.page.queryParams.userId = $.wyui.page.urlParams.userId ? $.wyui.page.urlParams.userId : getCurrentUser().id;
    $.extend($.wyui.page.queryParams, {
        "modelName": $.wyui.page.urlParams.modelName,
        "contractType":$.wyui.page.urlParams.contractType
    });
    $.wyui.page.getByPage_callback = function (r) {
        //console.log(r)
        // app.list.verifying = r.verifying;
        // app.list.pass = r.pass;
        app.list.main = r;
        //console.log(app.list.main)
        document.getElementById("scrollDiv").scrollTop = 0;
    };
    $.wyui.page.getByPage_scroll_callback = function (list) {
        if (list.length < 30) {
            isLoad = false;
        } else {
            for (var i = 0; i < list.length; i++) {
                app.list.push(list[i]);
            }
            isLoad = true;
        }
    };
    $(function () {
        $("#txtParent").autoComplete({
            url: server.ip + "/weekPlan/getNameAndTel.json",
            render: function (r, panel) {
                for (var i = 0; i < r.length; i++) {
                    $("<li></li>").data("autoComplete",
                        r[i]).html("<a>" + r[i].customerName + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + r[i].customerTel + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (r) {
                app.searchParams.customerKeyId = r.customerId;
                app.searchParams.customerKey = r.customerName;
                return false;
            },
            extraParams: {createUserId: getCurrentUser().id},
            height: 210,
            width: 300
        })
        $("#regionManagerName").autoComplete({
            url: server.ip + urlConfig.system.user.getTop10ByNameUser,
            render: function (users, panel) {
                for (var i = 0; i < users.length; i++) {
                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (user) {
                app.searchParams.regionManagerKeyId = user.id;
                app.searchParams.createUserName = user.name;
                return false;
            },
            height: 210,
            width: 220
        });

    });
</script>
</body>
</html>